#encoding=utf8
'''
Created on Apr 14, 2015

@author: jingyang <jingyang@smalltreemedia.com>
'''
from notification.models import Notice


def get_unread_count(request):
    count = 0
    if request.user.is_authenticated():
        count = Notice.objects.filter(read=False, receiver=request.user).count()
    return {'count': count}
